Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update stdsimd #57808

Merged
merged 1 commit into from
Jan 29, 2019
Merged

Update stdsimd #57808

merged 1 commit into from
Jan 29, 2019

Conversation

gnzlbg
Copy link
Contributor

@gnzlbg gnzlbg commented Jan 21, 2019

This is the companion PR to rust-lang/stdarch#640

r? @alexcrichton

@rust-highfive
Copy link
Collaborator

⚠️ Warning ⚠️

  • These commits modify submodules.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 21, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:1c25d732:start=1548093176753043609,finish=1548093177632981698,duration=879938089
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:00:00] Submodule 'src/doc/edition-guide' (https://github.com/rust-lang-nursery/edition-guide) registered for path 'src/doc/edition-guide'
[00:00:00] Submodule 'src/doc/nomicon' (https://github.com/rust-lang-nursery/nomicon.git) registered for path 'src/doc/nomicon'
[00:00:00] Submodule 'src/doc/reference' (https://github.com/rust-lang-nursery/reference.git) registered for path 'src/doc/reference'
[00:00:00] Submodule 'src/doc/rustc-guide' (https://github.com/rust-lang/rustc-guide.git) registered for path 'src/doc/rustc-guide'
[00:00:00] Submodule 'src/stdsimd' (https://github.com/gnzlbg/stdsimd.git) registered for path 'src/stdsimd'
[00:00:00] Submodule 'src/tools/clippy' (https://github.com/rust-lang-nursery/rust-clippy.git) registered for path 'src/tools/clippy'
[00:00:00] Submodule 'src/tools/miri' (https://github.com/solson/miri.git) registered for path 'src/tools/miri'
[00:00:00] Submodule 'src/tools/rls' (https://github.com/rust-lang-nursery/rls.git) registered for path 'src/tools/rls'
[00:00:00] Submodule 'src/rust-installer' (https://github.com/rust-lang/rust-installer.git) registered for path 'src/tools/rust-installer'
---
##############################################################            86.2%
######################################################################## 100.0%
[00:01:56] extracting /checkout/obj/build/cache/2019-01-04/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:56]     Updating crates.io index
[00:02:06]     Updating git repository `https://github.com/gnzlbg/stdsimd`
[00:02:07] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:07] Build completed unsuccessfully in 0:00:26
[00:02:07] Makefile:71: recipe for target 'prepare' failed
[00:02:07] make: *** [prepare] Error 1
[00:02:08] Command failed. Attempt 2/5:
[00:02:08] Command failed. Attempt 2/5:
[00:02:08]     Updating git repository `https://github.com/gnzlbg/stdsimd`
[00:02:09] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:09] Build completed unsuccessfully in 0:00:00
[00:02:09] Makefile:71: recipe for target 'prepare' failed
[00:02:09] make: *** [prepare] Error 1
[00:02:11] Command failed. Attempt 3/5:
[00:02:11] Command failed. Attempt 3/5:
[00:02:11]     Updating git repository `https://github.com/gnzlbg/stdsimd`
[00:02:11] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:11] Build completed unsuccessfully in 0:00:00
[00:02:11] Makefile:71: recipe for target 'prepare' failed
[00:02:11] make: *** [prepare] Error 1
[00:02:14] Command failed. Attempt 4/5:
[00:02:14] Command failed. Attempt 4/5:
[00:02:14]     Updating git repository `https://github.com/gnzlbg/stdsimd`
[00:02:15] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:15] Build completed unsuccessfully in 0:00:00
[00:02:15] Makefile:71: recipe for target 'prepare' failed
[00:02:15] make: *** [prepare] Error 1
[00:02:19] Command failed. Attempt 5/5:
[00:02:19] Command failed. Attempt 5/5:
[00:02:19]     Updating git repository `https://github.com/gnzlbg/stdsimd`
[00:02:19] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:19] Build completed unsuccessfully in 0:00:00
[00:02:19] Makefile:71: recipe for target 'prepare' failed
[00:02:19] make: *** [prepare] Error 1
[00:02:19] The command has failed after 5 attempts.
---
travis_time:end:0974384a:start=1548093331876735984,finish=1548093331883289736,duration=6553752
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1af515ec
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0538f7da
travis_time:start:0538f7da
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:120c3480
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:0dc0ccf8:start=1548165344292103971,finish=1548165417886748937,duration=73594644966
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:00:00] Submodule 'src/doc/edition-guide' (https://github.com/rust-lang-nursery/edition-guide) registered for path 'src/doc/edition-guide'
[00:00:00] Submodule 'src/doc/nomicon' (https://github.com/rust-lang-nursery/nomicon.git) registered for path 'src/doc/nomicon'
[00:00:00] Submodule 'src/doc/reference' (https://github.com/rust-lang-nursery/reference.git) registered for path 'src/doc/reference'
[00:00:00] Submodule 'src/doc/rustc-guide' (https://github.com/rust-lang/rustc-guide.git) registered for path 'src/doc/rustc-guide'
[00:00:00] Submodule 'src/stdsimd' (https://github.com/gnzlbg/stdsimd.git) registered for path 'src/stdsimd'
[00:00:00] Submodule 'src/tools/clippy' (https://github.com/rust-lang-nursery/rust-clippy.git) registered for path 'src/tools/clippy'
[00:00:00] Submodule 'src/tools/miri' (https://github.com/solson/miri.git) registered for path 'src/tools/miri'
[00:00:00] Submodule 'src/tools/rls' (https://github.com/rust-lang-nursery/rls.git) registered for path 'src/tools/rls'
[00:00:00] Submodule 'src/rust-installer' (https://github.com/rust-lang/rust-installer.git) registered for path 'src/tools/rust-installer'
---
#####################################################                     74.6%
######################################################################## 100.0%
[00:01:17] extracting /checkout/obj/build/cache/2019-01-04/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:17]     Updating crates.io index
[00:01:27]     Updating git repository `https://github.com/gnzlbg/stdsimd`
[00:01:29]   Downloaded time v0.1.40
[00:01:29]   Downloaded lazy_static v0.2.11
[00:01:29]   Downloaded toml v0.4.10
[00:01:29]   Downloaded num_cpus v1.8.0
---
travis_time:start:tidy
tidy check
[00:03:25] * 564 error codes
[00:03:25] * highest error code: E0721
[00:03:25] tidy error: /checkout/src/libstd/lib.rs:346: mismatches the `issue` in previous
[00:03:26] Dependencies not on the whitelist:
[00:03:26] * wasm-bindgen 
[00:03:26] * wasm-bindgen-backend 
[00:03:26] * wasm-bindgen-macro 
[00:03:26] * wasm-bindgen-macro-support 
[00:03:26] * wasm-bindgen-shared 
[00:03:26] invalid source: "git+https://github.com/gnzlbg/stdsimd?branch=refactor#13941f86a89aca89acf3bb38c209f2ad2fb972c9"
[00:03:26] some tidy checks failed
[00:03:26] 
[00:03:26] 
[00:03:26] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:26] 
[00:03:26] 
[00:03:26] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:26] Build completed unsuccessfully in 0:00:48
[00:03:26] Build completed unsuccessfully in 0:00:48
[00:03:26] make: *** [tidy] Error 1
[00:03:26] Makefile:69: recipe for target 'tidy' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:106074b4
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Jan 22 14:00:33 UTC 2019
---
travis_time:end:09862f7d:start=1548165634103576758,finish=1548165634108290597,duration=4713839
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:215c62da
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:242f3b80
travis_time:start:242f3b80
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0525c188
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@gnzlbg gnzlbg force-pushed the ustdsimd branch 2 times, most recently from 160a34c to 4e7110b Compare January 22, 2019 15:43
@@ -365,6 +368,8 @@ pub mod prelude;
// Public module declarations and re-exports
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::any;
#[stable(feature = "simd_arch", since = "1.27.0")]
pub use core::arch;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the largest change here. Instead of re-compiling core::arch again and including it two times, one in std and one in core, this PR changes libstd to re-export the intrinsics from core directly.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:046fe0b0:start=1548172196590680549,finish=1548172290939488200,duration=94348807651
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:00:00] Submodule 'src/doc/edition-guide' (https://github.com/rust-lang-nursery/edition-guide) registered for path 'src/doc/edition-guide'
[00:00:00] Submodule 'src/doc/nomicon' (https://github.com/rust-lang-nursery/nomicon.git) registered for path 'src/doc/nomicon'
[00:00:00] Submodule 'src/doc/reference' (https://github.com/rust-lang-nursery/reference.git) registered for path 'src/doc/reference'
[00:00:00] Submodule 'src/doc/rustc-guide' (https://github.com/rust-lang/rustc-guide.git) registered for path 'src/doc/rustc-guide'
[00:00:00] Submodule 'src/stdsimd' (https://github.com/gnzlbg/stdsimd.git) registered for path 'src/stdsimd'
[00:00:00] Submodule 'src/tools/clippy' (https://github.com/rust-lang-nursery/rust-clippy.git) registered for path 'src/tools/clippy'
[00:00:00] Submodule 'src/tools/miri' (https://github.com/solson/miri.git) registered for path 'src/tools/miri'
[00:00:00] Submodule 'src/tools/rls' (https://github.com/rust-lang-nursery/rls.git) registered for path 'src/tools/rls'
[00:00:00] Submodule 'src/rust-installer' (https://github.com/rust-lang/rust-installer.git) registered for path 'src/tools/rust-installer'
---
[00:01:34] 
######################################################################## 100.0%
[00:01:34] extracting /checkout/obj/build/cache/2019-01-04/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:34]     Updating crates.io index
[00:01:48]     Updating git repository `https://github.com/gnzlbg/cfg-if`
[00:01:49]   Downloaded cc v1.0.28
[00:01:49]   Downloaded lazy_static v0.2.11
[00:01:49]   Downloaded libc v0.2.46
[00:01:49]   Downloaded serde v1.0.82
---
tidy check
[00:03:49] * 564 error codes
[00:03:49] * highest error code: E0721
[00:03:49] * 246 features
[00:03:50] invalid source: "git+https://github.com/gnzlbg/cfg-if?branch=no_core#028a30c4ba3d78d7d79e199f402c3942b8f69659"
[00:03:50] some tidy checks failed
[00:03:50] 
[00:03:50] 
[00:03:50] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:50] 
[00:03:50] 
[00:03:50] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:50] Build completed unsuccessfully in 0:00:50
[00:03:50] Build completed unsuccessfully in 0:00:50
[00:03:50] Makefile:69: recipe for target 'tidy' failed
[00:03:50] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:231f18ba
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Jan 22 15:55:30 UTC 2019
---
travis_time:end:1acd1728:start=1548172531241780687,finish=1548172531246550655,duration=4769968
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:080bb35a
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:276140d5
travis_time:start:276140d5
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:04799be6
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexcrichton
Copy link
Member

To make sure I understand what's going on here, is the idea that std::arch is exactly the same as core::arch except for the macros, and as a result the macros can be defined in a separate location?

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jan 22, 2019

The idea is that std::arch is core::arch.

The run-time feature detection macros (e.g. is_x86_feature_detected) are exported by libstd (they are not available in libcore) but I don't think we guaranteed anything about their import path (e.g. use std::arch::is_x86_feature_detected), only that they are available in the std prelude.

The std_detect crate provides the run-time feature detection macros, and core_arch provides core::arch (which is just std::arch).

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jan 22, 2019

So I've reverted the code that added cfg-if as a dependency and updated this with stdsimd upstream. Hopefully the update goes smoothly.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:09982f08:start=1548184560769430771,finish=1548184649899393436,duration=89129962665
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
tidy check
[00:03:34] * 564 error codes
[00:03:34] * highest error code: E0721
[00:03:34] * 246 features
[00:03:34] tidy error: /checkout/src/libstd/tests/run-time-detect.rs:4: platform-specific cfg: cfg(all(target_arch = "arm", any(target_os = "linux", target_os = "android")))
[00:03:34] tidy error: /checkout/src/libstd/tests/run-time-detect.rs:11: platform-specific cfg: cfg(all(
[00:03:34]     target_arch = "aarch64",
[00:03:34]     any(target_os = "linux", target_os = "android")
[00:03:34] ))
[00:03:34] tidy error: /checkout/src/libstd/tests/run-time-detect.rs:30: platform-specific cfg: cfg(all(target_arch = "powerpc", target_os = "linux"))
[00:03:34] tidy error: /checkout/src/libstd/tests/run-time-detect.rs:38: platform-specific cfg: cfg(all(target_arch = "powerpc64", target_os = "linux"))
[00:03:35] some tidy checks failed
[00:03:35] 
[00:03:35] 
[00:03:35] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:35] 
[00:03:35] 
[00:03:35] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:35] Build completed unsuccessfully in 0:00:45
[00:03:35] Build completed unsuccessfully in 0:00:45
[00:03:35] Makefile:69: recipe for target 'tidy' failed
[00:03:35] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0861464a
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Jan 22 19:21:15 UTC 2019
---
travis_time:end:05983b5a:start=1548184875753804193,finish=1548184875758129648,duration=4325455
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:070451df
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0613d602
travis_time:start:0613d602
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:17c97226
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexcrichton
Copy link
Member

Ok sounds good to me!

Can you double-check locally that std::detect is considered unstable? No need to add a test, just want to make sure we've got our bases covered there

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jan 23, 2019

@alexcrichton I've made std::detect unstable, and added a test that exercises the feature detection macros to libstd. The test pass locally for me and I've verified the output manually on my machine.

The test should break on CI because the non-x86 macros are unstable and the test does not enable the stdsimd feature but I'd prefer to give that a try and verify that CI breaks as I expect. (I will add a#[cfg_attr(not(any(target_arch = "x86", target_arch = "x86_64")), feature(stdsimd))] afterwards to make the tests pass). EDIT: thinking about this, there are no non-x86 tier-1 targets, so this test won't run on the other targets so nothing should break.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:1191ea6c:start=1548255353765968981,finish=1548255425278218826,duration=71512249845
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
travis_time:start:tidy
tidy check
[00:05:47] * 564 error codes
[00:05:47] * highest error code: E0721
[00:05:48] tidy error: /checkout/src/libstd/lib.rs:514: mismatches the `issue` in previous
[00:05:48] some tidy checks failed
[00:05:48] 
[00:05:48] 
[00:05:48] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:05:48] 
[00:05:48] 
[00:05:48] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:05:48] Build completed unsuccessfully in 0:00:50
[00:05:48] Build completed unsuccessfully in 0:00:50
[00:05:49] make: *** [tidy] Error 1
[00:05:49] Makefile:69: recipe for target 'tidy' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:00b41fb0
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Jan 23 15:03:03 UTC 2019
---
travis_time:end:0ce0875e:start=1548255784378207943,finish=1548255784382386853,duration=4178910
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:00da98bf
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0121a070
travis_time:start:0121a070
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:033f9042
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexcrichton
Copy link
Member

@bors: delegate+ r+

Looks and sounds great to me!

@bors
Copy link
Contributor

bors commented Jan 23, 2019

📌 Commit 08310e7cdde17d58925347d083a09014c97afa7a has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jan 23, 2019

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

@bors
Copy link
Contributor

bors commented Jan 23, 2019

✌️ @gnzlbg can now approve this pull request

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 23, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:021c86a6:start=1548258600206082521,finish=1548258693623223753,duration=93417141232
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:12:13] 
[01:12:13] running 118 tests
[01:12:37] .iiiii...i.....i..i...i..i.i..i.ii..i.....i..i....i..........iiii..........i...ii...i.......ii.i.i.i 100/118
[01:12:40] ......iii.i.....ii
[01:12:40] 
[01:12:40]  finished in 27.674
[01:12:40] travis_fold:end:test_debuginfo

---
[01:24:32] 
[01:24:32]    Doc-tests core
[01:24:38] 
[01:24:38] running 2240 tests
[01:24:48] FFFFiFFiiiiiiF...................................................................................... 100/2240
[01:25:13] .................................................................................................... 300/2240
[01:25:27] ..........................................................i......................................... 400/2240
[01:25:39] .................................................................................................... 500/2240
[01:25:50] .................................................................................................... 600/2240
---
[01:29:08]    |
[01:29:08] 10 | extern crate std_detect;
[01:29:08]    | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
[01:29:08] 
[01:29:08] thread '../stdsimd/crates/core_arch/src/macros.rs - core_arch::x86::__m256 (line 292)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:354:13
[01:29:08] 
[01:29:08] ---- ../stdsimd/crates/core_arch/src/macros.rs - core_arch::x86::__m128i (line 299) stdout ----
[01:29:08] error[E0463]: can't find crate for `std_detect`
[01:29:08]   --> ../stdsimd/crates/core_arch/src/macros.rs:307:1
[01:29:08]   --> ../stdsimd/crates/core_arch/src/macros.rs:307:1
[01:29:08]    |
[01:29:08] 10 | extern crate std_detect;
[01:29:08]    | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
[01:29:08] 
[01:29:08] thread '../stdsimd/crates/core_arch/src/macros.rs - core_arch::x86::__m128i (line 299)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:354:13
[01:29:08] ---- ../stdsimd/crates/core_arch/src/macros.rs - core_arch::x86::__m128d (line 292) stdout ----
[01:29:08] error[E0463]: can't find crate for `std_detect`
[01:29:08]   --> ../stdsimd/crates/core_arch/src/macros.rs:300:1
[01:29:08]    |
[01:29:08]    |
[01:29:08] 10 | extern crate std_detect;
[01:29:08]    | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
[01:29:08] 
[01:29:08] thread '../stdsimd/crates/core_arch/src/macros.rs - core_arch::x86::__m128d (line 292)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:354:13
[01:29:08] ---- ../stdsimd/crates/core_arch/src/macros.rs - core_arch::x86::__m128 (line 292) stdout ----
[01:29:08] error[E0463]: can't find crate for `std_detect`
[01:29:08]   --> ../stdsimd/crates/core_arch/src/macros.rs:300:1
[01:29:08]    |
[01:29:08]    |
[01:29:08] 10 | extern crate std_detect;
[01:29:08]    | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
[01:29:08] 
[01:29:08] thread '../stdsimd/crates/core_arch/src/macros.rs - core_arch::x86::__m128 (line 292)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:354:13
[01:29:08] ---- ../stdsimd/crates/core_arch/src/macros.rs - core_arch::x86::__m256d (line 292) stdout ----
[01:29:08] error[E0463]: can't find crate for `std_detect`
[01:29:08]   --> ../stdsimd/crates/core_arch/src/macros.rs:300:1
[01:29:08]    |
[01:29:08]    |
[01:29:08] 10 | extern crate std_detect;
[01:29:08]    | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
[01:29:08] 
[01:29:08] thread '../stdsimd/crates/core_arch/src/macros.rs - core_arch::x86::__m256d (line 292)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:354:13
[01:29:08] ---- ../stdsimd/crates/core_arch/src/macros.rs - core_arch::x86::__m256i (line 296) stdout ----
[01:29:08] error[E0463]: can't find crate for `std_detect`
[01:29:08]   --> ../stdsimd/crates/core_arch/src/macros.rs:304:1
[01:29:08]    |
[01:29:08]    |
[01:29:08] 10 | extern crate std_detect;
[01:29:08]    | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
[01:29:08] 
[01:29:08] thread '..execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--" "--quiet"
[01:29:08] 
[01:29:08] 
[01:29:08] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:29:08] Build completed unsuccessfully in 0:28:28
[01:29:08] Build completed unsuccessfully in 0:28:28
[01:29:08] make: *** [check] Error 1
[01:29:08] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:2a97df58
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Jan 23 17:20:50 UTC 2019

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexcrichton
Copy link
Member

@bors: r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 23, 2019
@Centril
Copy link
Contributor

Centril commented Jan 28, 2019

@bors p=1

@bors
Copy link
Contributor

bors commented Jan 29, 2019

⌛ Testing commit f4ed39ca06f86a1b46a1036fde507ccb381529c5 with merge 49ee342497e3db2ef201f099b9dc33fc7f20c858...

@bors
Copy link
Contributor

bors commented Jan 29, 2019

💔 Test failed - checks-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 29, 2019
@rust-highfive
Copy link
Collaborator

The job armhf-gnu of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[01:44:30] travis_fold:start:test_stage2-std
travis_time:start:test_stage2-std
Testing std stage2 (x86_64-unknown-linux-gnu -> arm-unknown-linux-gnueabihf)
[01:44:30]    Compiling std v0.0.0 (/checkout/src/libstd)
[01:44:30] error[E0658]: macro is_arm_feature_detected! is unstable (see issue #27731)
[01:44:30]  --> src/libstd/tests/run-time-detect.rs:7:26
[01:44:30]   |
[01:44:30] 7 |     println!("neon: {}", is_arm_feature_detected!("neon"));
[01:44:30]   |
[01:44:30]   |
[01:44:30]   = help: add #![feature(stdsimd)] to the crate attributes to enable
[01:44:30] 
[01:44:30] error[E0658]: macro is_arm_feature_detected! is unstable (see issue #27731)
[01:44:30]  --> src/libstd/tests/run-time-detect.rs:8:27
[01:44:30]   |
[01:44:30] 8 |     println!("pmull: {}", is_arm_feature_detected!("pmull"));
[01:44:30]   |
[01:44:30]   |
[01:44:30]   = help: add #![feature(stdsimd)] to the crate attributes to enable
[01:44:30] error: aborting due to 2 previous errors
[01:44:30] 
[01:44:30] For more information about this error, try `rustc --explain E0658`.
[01:44:30] [RUSTC-TIMING] run_time_detect test:true 0.124
[01:44:30] [RUSTC-TIMING] run_time_detect test:true 0.124
[01:44:30] error: Could not compile `std`.
[01:44:30] warning: build failed, waiting for other jobs to finish...
[01:44:31] [RUSTC-TIMING] env test:true 1.121
[01:47:08] [RUSTC-TIMING] std test:true 157.267
[01:47:08] error: build failed
[01:47:08] 
[01:47:08] 
[01:47:08] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "arm-unknown-linux-gnueabihf" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "std" "--"
[01:47:08] 
[01:47:08] 
[01:47:08] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target arm-unknown-linux-gnueabihf
[01:47:08] Build completed unsuccessfully in 1:43:43
---
travis_time:end:00047f13:start=1548754813078802367,finish=1548754813087686176,duration=8883809
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0cebcc94
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:07be3cf8
travis_time:start:07be3cf8
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:203d5ec8
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jan 29, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented Jan 29, 2019

📌 Commit 938a814 has been approved by gnzlbg

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2019
@bors
Copy link
Contributor

bors commented Jan 29, 2019

⌛ Testing commit 938a814 with merge e96c5f7f7434ed8d985413f2b8b4444861008ee7...

@bors
Copy link
Contributor

bors commented Jan 29, 2019

💔 Test failed - checks-travis

@rust-highfive
Copy link
Collaborator

Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
Attempting to download s3://rust-lang-ci-sccache2/docker/b7aed34d96e2c2f5afd13be57bfad1368aa0caccb20d7c328adbe63c0915133af8a0fcf7be5c0266a12db603a9feb7804c872556e1e953cdb1cf776c13596f07
[00:00:42] Attempting with retry: curl -f -L -C - -o /tmp/rustci_docker_cache https://s3-us-west-1.amazonaws.com/rust-lang-ci-sccache2/docker/b7aed34d96e2c2f5afd13be57bfad1368aa0caccb20d7c328adbe63c0915133af8a0fcf7be5c0266a12db603a9feb7804c872556e1e953cdb1cf776c13596f07
[00:00:42]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[00:00:42]                                  Dload  Upload   Total   Spent    Left  Speed
No output has been received in the last 30m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 29, 2019
@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jan 29, 2019

@bors: retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2019
@bors
Copy link
Contributor

bors commented Jan 29, 2019

⌛ Testing commit 938a814 with merge c1c3c4e...

bors added a commit that referenced this pull request Jan 29, 2019
@bors
Copy link
Contributor

bors commented Jan 29, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: gnzlbg
Pushing c1c3c4e to master...

@bors bors merged commit 938a814 into rust-lang:master Jan 29, 2019
dgreid pushed a commit to dgreid/crosvm that referenced this pull request Feb 25, 2020
Use the Rust __cpuid and __cpuid_count intrinsics to replace the C
implementation in host_cpuid.c.

These are defined in core, but they are also re-exported in std, despite
being undocumented there due to technical reasons:
rust-lang/rust#57808 (comment)

Use the std version for consistency (we don't currently use anything
from core anywhere else in crosvm).

BUG=None
TEST=cargo test -p x86_64
TEST=Boot crosvm on x86_64

Change-Id: Ic7a1094d1b804304a2944f8ee1fe55c5e2db23e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2067159
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants